package com.example.shop.db

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.example.base.entity.CarEntity

@Dao
interface OrderDao {
    //新增待结算订单
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertOrder(carEntity: CarEntity)
    //修改订单状态为 待支付或者已支付
    @Update
    fun updateOrder(carEntity: CarEntity)
    //查询符合条件的订单
    @Query("select * from `order` where orderStatus = :status")
    fun queryOrder(status:Int):List<CarEntity>
}